package com.xoa.controller.party;


import com.xoa.model.party.EsCommittee;
import com.xoa.service.party.EsCommitteeService;
import com.xoa.util.ToJson;
import com.xoa.util.common.newwrapper.BaseWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 社区居委会
 * Created by gsb on 2018/1/11.
 */
@Controller
@RequestMapping("/esCommittee")
public class EsCommitteeController {

    @Resource
    private EsCommitteeService esCommitteeService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午14:42:51
     * 类介绍  :  新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EsCommittee> insertSelective(EsCommittee esCommittee, HttpServletRequest request, String gridLocation){
        return esCommitteeService.insertSelective(esCommittee, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:22:51
     * 类介绍  :  删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EsCommittee> deleteByPrimaryKey(Integer cid){
        return esCommitteeService.deleteByPrimaryKey(cid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:22:51
     * 类介绍  :  修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EsCommittee> updateByPrimaryKeySelective(EsCommittee esCommittee, String gridLocation){
        return esCommitteeService.updateByPrimaryKeySelective(esCommittee,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:22:51
     * 类介绍  :  详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EsCommittee> selectById(Integer cid){
        return esCommitteeService.selectById(cid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:22:51
     * 类介绍  :  列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EsCommittee> queryList(EsCommittee esCommittee, Integer page, Integer pageSize,
                                         boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return esCommitteeService.queryList(esCommittee, page, pageSize, useFlag, request, response, export);
    }

    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response){
        return esCommitteeService.outPutFile(request,response);
    }

    /**
     *
     * 创建作者:   郭心雨
     * 创建日期:   2018-1-11 下午15:22:51
     * 类介绍  :  列表新
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryListNew")
    @ResponseBody
    public ToJson<EsCommittee> queryListNew(EsCommittee esCommittee, Integer page, Integer pageSize,
                                            boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return esCommitteeService.queryListNew(esCommittee, page, pageSize, useFlag, request, response, export);
    }
}
